package com.example.yyjc.controller;

import com.example.yyjc.domain.countryanalyze.*;
import com.example.yyjc.domain.industryanalyze.*;
import com.example.yyjc.domain.selectionanalyze.CountrySecondCatCase;
import com.example.yyjc.service.SelectService;
import com.example.yyjc.util.excel.ExcelUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @ClassName SelectController
 * @Description TODO   查询所有列表内容
 * @Author lvyongwei
 * @Date 2021-2-21
 **/
@Controller
@CrossOrigin
@RequestMapping("/select")
public class SelectController {

    @Autowired
    private ExcelUtils excelUtils;

    @Autowired
    private SelectService selectService;

    /**
     * 导出所有的国家日期
     * @param request
     * @param response
     */
    @GetMapping("/getCountry")
    public void getCountry(HttpServletRequest request, HttpServletResponse response){
        List<Country> countryList = selectService.getCountry();
        excelUtils.cooperationData(request,response,countryList,"国家日期历史数据",Country.class);
    }

    /**
     * 获取模板
     */
    @GetMapping("/getCountryTemplate")
    public void getCountryTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, Country.class,"国家日期模板");
    }

    /**
     * 导出所有的国家商品数量占比
     * @param request
     * @param response
     */
    @GetMapping("/getOrderCountAnalysis")
    public void getOrderCountAnalysis(HttpServletRequest request, HttpServletResponse response){
        List<OrderCountAnalysis> countryList = selectService.getOrderCountAnalysis();
        excelUtils.cooperationData(request,response,countryList,"国家商品数量占比历史数据",OrderCountAnalysis.class);
    }

    /**
     * 获取所有的国家商品数量占比模板
     */
    @GetMapping("/getOrderCountAnalysisTemplate")
    public void getOrderCountAnalysisTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, OrderCountAnalysis.class,"商品数量占比模板");
    }

    /**
     * 导出所有的国家商品价格占比
     * @param request
     * @param response
     */
    @GetMapping("/getPriceCountAnalysis")
    public void getPriceCountAnalysis(HttpServletRequest request, HttpServletResponse response){
        List<PriceCountAnalysis> countryList = selectService.getPriceCountAnalysis();
        excelUtils.cooperationData(request,response,countryList,"国家商品价格占比历史数据",PriceCountAnalysis.class);
    }

    /**
     * 获取所有的商品价格占比模板
     */
    @GetMapping("/getPriceCountAnalysisTemplate")
    public void getPriceCountAnalysisTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, PriceCountAnalysis.class,"商品价格占比模板");
    }

    /**
     * 查询国家月份一级类目占比
     * @param request
     * @param response
     */
    @GetMapping("/getMainTitleScale")
    public void getMainTitleScale(HttpServletRequest request, HttpServletResponse response){
        List<MainTitleScale> mainTitleScales = selectService.getMainTitleScale();
        excelUtils.cooperationData(request,response,mainTitleScales,"国家月份一级类目占比历史数据",MainTitleScale.class);
    }

    /**
     * 获取查询国家月份一级类目占比模板
     */
    @GetMapping("/getMainTitleScaleTemplate")
    public void getMainTitleScaleTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, MainTitleScale.class,"国家月份一级类目占比模板");
    }

    /**
     * 查询国家每个月份物流订单
     * @param request
     * @param response
     */
    @GetMapping("/getLogisticsOrder")
    public void getLogisticsOrder(HttpServletRequest request, HttpServletResponse response){
        List<LogisticsOrder> logisticsOrders = selectService.getLogisticsOrder();
        excelUtils.cooperationData(request,response,logisticsOrders,"国家每个月份物流订单历史数据",LogisticsOrder.class);
    }

    /**
     * 获取查询国家每个月份物流订单模板
     */
    @GetMapping("/getLogisticsOrderTemplate")
    public void getLogisticsOrderTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, LogisticsOrder.class,"国家每个月份物流订单模板");
    }

    /**
     * 查询国家每个月份top10店铺
     * @param request
     * @param response
     */
    @GetMapping("/getShopTopTen")
    public void getShopTopTen(HttpServletRequest request, HttpServletResponse response){
        List<ShopTopTen> shopTopTen = selectService.getShopTopTen();
        excelUtils.cooperationData(request,response,shopTopTen,"国家每个月份top100店铺历史数据",ShopTopTen.class);
    }

    /**
     * 获取查询国家每个月份top10店铺模板
     */
    @GetMapping("/getShopTopTenTemplate")
    public void getShopTopTenTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, ShopTopTen.class,"国家每个月份top100店铺模板");
    }

    /**
     * 查询国家每个月份top10商品
     * @param request
     * @param response
     */
    @GetMapping("/getGoodsTopTen")
    public void getGoodsTopTen(HttpServletRequest request, HttpServletResponse response){
        List<GoodsTopTen> shopTopTen = selectService.getGoodsTopTen();
        excelUtils.cooperationData(request,response,shopTopTen,"国家每个月份top10商品历史数据",GoodsTopTen.class);
    }

    /**
     * 获取查询国家每个月份top10商品模板
     */
    @GetMapping("/getGoodsTopTenTemplate")
    public void getGoodsTopTenTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, GoodsTopTen.class,"国家每个月份top10商品模板");
    }

    /**
     * 查询国家每个月份top1店铺
     * @param request
     * @param response
     */
    @GetMapping("/getCountryTopOneShopName")
    public void getCountryTopOneShopName(HttpServletRequest request, HttpServletResponse response){
        List<CountryTopOneShopName> countryTopOneShopName = selectService.getCountryTopOneShopName();
        excelUtils.cooperationData(request,response,countryTopOneShopName,"国家每个月份top1店铺历史数据",CountryTopOneShopName.class);
    }

    /**
     * 获取查询国家每个月份top1店铺
     */
    @GetMapping("/getCountryTopOneShopNameTemplate")
    public void getCountryTopOneShopNameTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, CountryTopOneShopName.class,"国家每个月份top1店铺模板");
    }

    /**
     * 查询国家每个月份top1商品信息
     * @param request
     * @param response
     */
    @GetMapping("/getCountryTopOneShopMsg")
    public void getCountryTopOneShopMsg(HttpServletRequest request, HttpServletResponse response){
        List<CountryToponeShopMsg> countryToponeShopMsgs = selectService.getCountryToponeShopMsg();
        excelUtils.cooperationData(request,response,countryToponeShopMsgs,"国家每个月份top1店铺商品历史数据",CountryToponeShopMsg.class);
    }

    /**
     * 获取国家每个月份top1商品信息模板
     */
    @GetMapping("/getCountryTopOneShopMsgTemplate")
    public void getCountryTopOneShopMsgTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, CountryToponeShopMsg.class,"国家每个月份top1店铺商品模板");
    }


    /**
     * 查询所有一级类目信息
     * @param request
     * @param response
     */
    @GetMapping("/getFirstCat")
    public void getFirstCat(HttpServletRequest request, HttpServletResponse response){
        List<FirstCat> firstCat = selectService.getFirstCat();
        excelUtils.cooperationData(request,response,firstCat,"所有一级类目历史数据",FirstCat.class);
    }

    /**
     * 获取所有一级类目信息模板
     */
    @GetMapping("/getFirstCatTemplate")
    public void getFirstCatTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, FirstCat.class,"所有一级类目模板");
    }

    /**
     * 查询所有一级类目每月销售额
     * @param request
     * @param response
     */
    @GetMapping("/getFirstCatSale")
    public void getFirstCatSale(HttpServletRequest request, HttpServletResponse response){
        List<FirstCatSale> firstCatSale = selectService.getFirstCatSale();
        excelUtils.cooperationData(request,response,firstCatSale,"所有一级类目每月销售额历史数据",FirstCatSale.class);
    }

    /**
     * 获取所有一级类目每月销售额模板
     */
    @GetMapping("/getFirstCatSaleTemplate")
    public void getFirstCatSaleTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, FirstCatSale.class,"所有一级类目每月销售额模板");
    }

    /**
     * 查询所有二级类目信息
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCat")
    public void getSecondCat(HttpServletRequest request, HttpServletResponse response){
        List<SecondCat> secondCat = selectService.getSecondCat();
        excelUtils.cooperationData(request,response,secondCat,"所有二级类目历史数据",SecondCat.class);
    }

    /**
     * 获取所有二级类目信息模板
     */
    @GetMapping("/getSecondCatTemplate")
    public void getSecondCatTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCat.class,"所有二级类目模板");
    }

    /**
     * 查询所有二级类目每月销售额
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatSale")
    public void getSecondCatSale(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatSale> secondCatSale = selectService.getSecondCatSale();
        excelUtils.cooperationData(request,response,secondCatSale,"所有二级类目每月销售额历史数据",SecondCatSale.class);
    }

    /**
     * 获取所有二级类目每月销售额模板
     */
    @GetMapping("/getSecondCatSaleTemplate")
    public void getSecondCatSaleTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatSale.class,"所有二级类目每月销售额模板");
    }

    /**
     * 获取国家每月二级类目销售额信息
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatCountrySaleCount")
    public void getSecondCatCountrySaleCount(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatCountrySaleCount> secondCatCountrySale = selectService.getSecondCatCountrySaleCount();
        excelUtils.cooperationData(request,response,secondCatCountrySale,"所有国家每月二级类目销售额历史数据",SecondCatCountrySaleCount.class);
    }

    /**
     * 获取国家每月二级类目销售额信息模板
     */
    @GetMapping("/getSecondCatCountrySaleCountTemplate")
    public void getSecondCatCountrySaleCountTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatCountrySaleCount.class,"所有国家每月二级类目销售额模板");
    }

    /**
     * 获取二级类目每个月份国家物流订单量
     * @param request
     * @param response
     */
    @GetMapping("/getDeliveryCountry")
    public void getDeliveryCountry(HttpServletRequest request, HttpServletResponse response){
        List<DeliveryCountry> deliveryCountries = selectService.getDeliveryCountry();
        excelUtils.cooperationData(request,response,deliveryCountries,"二级类目每个月份国家物流订单量历史数据",DeliveryCountry.class);
    }

    /**
     * 获取国家每月二级类目销售额信息模板
     */
    @GetMapping("/getDeliveryCountryTemplate")
    public void getDeliveryCountryTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, DeliveryCountry.class,"二级类目每个月份国家物流订单量模板");
    }

    /**
     * 获取二级类目每个月份价格区间商品/订单数量
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatPriceScale")
    public void getSecondCatPriceScale(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatPriceScale> secondCatPriceScales = selectService.getSecondCatPriceScale();
        excelUtils.cooperationData(request,response,secondCatPriceScales,"二级类目每个月份价格区间商品/订单数量历史数据",SecondCatPriceScale.class);
    }

    /**
     * 获取二级类目每个月份价格区间商品/订单数量模板
     */
    @GetMapping("/getSecondCatPriceScaleTemplate")
    public void getSecondCatPriceScaleTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatPriceScale.class,"二级类目每个月份价格区间商品/订单数量模板");
    }

    /**
     * 获取二级类目每个月份订单区间商品/订单数量
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatOrderScale")
    public void getSecondCatOrderScale(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatOrderScale> secondCatOrderScale = selectService.getSecondCatOrderScale();
        excelUtils.cooperationData(request,response,secondCatOrderScale,"二级类目每个月份订单区间商品/订单数量历史数据",SecondCatOrderScale.class);
    }

    /**
     * 获取二级类目每个月份订单区间商品/订单数量模板
     */
    @GetMapping("/getSecondCatOrderScaleTemplate")
    public void getSecondCatOrderScaleTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatOrderScale.class,"二级类目每个月份订单区间商品/订单数量模板");
    }

    /**
     * 获取二级类目每个月top10店铺信息
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatShopTopTen")
    public void getSecondCatShopTopTen(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatShopTopTen> secondCatShopTopTen = selectService.getSecondCatShopTopTen();
        excelUtils.cooperationData(request,response,secondCatShopTopTen,"二级类目每个月top10店铺历史数据",SecondCatShopTopTen.class);
    }

    /**
     * 获取二级类目每个月top10店铺信息模板
     */
    @GetMapping("/getSecondCatShopTopTenTemplate")
    public void getSecondCatShopTopTenTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatShopTopTen.class,"二级类目每个月top10店铺模板");
    }

    /**
     * 获取二级类目每个月top10商品信息
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatGoodsTopTen")
    public void getSecondCatGoodsTopTen(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatGoodsTopTen> secondCatGoodsTopTen = selectService.getSecondCatGoodsTopTen();
        excelUtils.cooperationData(request,response,secondCatGoodsTopTen,"二级类目每个月top10商品历史数据",SecondCatGoodsTopTen.class);
    }

    /**
     * 获取二级类目每个月top10商品信息模板
     */
    @GetMapping("/getSecondCatGoodsTopTenTemplate")
    public void getSecondCatGoodsTopTenTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatGoodsTopTen.class,"二级类目每个月top10商品模板");
    }

    /**
     * 获取二级类目每个月top10国家top3物流信息
     * @param request
     * @param response
     */
    @GetMapping("/getSecondCatTopLogistics")
    public void getSecondCatTopLogistics(HttpServletRequest request, HttpServletResponse response){
        List<SecondCatTopLogistics> secondCatGoodsTopTen = selectService.getSecondCatTopLogistics();
        excelUtils.cooperationData(request,response,secondCatGoodsTopTen,"二级类目每个月top10国家top3物流历史数据",SecondCatTopLogistics.class);
    }

    /**
     * 获取二级类目每个月top10国家top3物流信息模板
     */
    @GetMapping("/getSecondCatTopLogisticsTemplate")
    public void getSecondCatTopLogisticsTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatTopLogistics.class,"二级类目每个月top10国家top3物流模板");
    }

    /**
     * 获取Aliexpress前10国家信息
     * @param request
     * @param response
     */
    @GetMapping("/getAliexpress")
    public void getAliexpress(HttpServletRequest request, HttpServletResponse response){
        List<Aliexpress> aliexpress = selectService.getAliexpress();
        excelUtils.cooperationData(request,response,aliexpress,"Aliexpress前10国家历史数据",Aliexpress.class);
    }

    /**
     * 获取Aliexpress前10国家信息模板
     */
    @GetMapping("/getAliexpressTemplate")
    public void getAliexpressTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, SecondCatTopLogistics.class,"Aliexpress前10国家模板");
    }

    /**
     * 获取Aliexpress的前10二级类目信息
     * @param request
     * @param response
     */
    @GetMapping("/getAliexpressSecondCatTopTen")
    public void getAliexpressSecondCatTopTen(HttpServletRequest request, HttpServletResponse response){
        List<AliexpressSecondCatTopTen> aliexpressSecondCatTopTen = selectService.getAliexpressSecondCatTopTen();
        excelUtils.cooperationData(request,response,aliexpressSecondCatTopTen,"Aliexpress的前10二级类目历史数据",AliexpressSecondCatTopTen.class);
    }

    /**
     * 获取Aliexpress的前10二级类目信息模板
     */
    @GetMapping("/getAliexpressSecondCatTopTenTemplate")
    public void getAliexpressSecondCatTopTenTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, AliexpressSecondCatTopTen.class,"Aliexpress的前10二级类目模板");
    }

    /**
     * 获取国家每个月份二级类目情况
     * @param request
     * @param response
     */
    @GetMapping("/getCountrySecondCatCase")
    public void getCountrySecondCatCase(HttpServletRequest request, HttpServletResponse response){
        List<CountrySecondCatCase> countrySecondCatCase = selectService.getCountrySecondCatCase();
        excelUtils.cooperationData(request,response,countrySecondCatCase,"获取国家每个月份二级类目历史数据",CountrySecondCatCase.class);
    }

    /**
     * 获取国家每个月份二级类目情况模板
     */
    @GetMapping("/getCountrySecondCatCaseTemplate")
    public void getCountrySecondCatCaseTemplate(HttpServletRequest request, HttpServletResponse response){
        excelUtils.cooperation(request,response, CountrySecondCatCase.class,"国家每个月份二级类目模板");
    }
}